package com.hs.hlw.credit.system.business.dto;

import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * DataSourceDto
 * @author zhb
 * @date 2018/10/29
 */
public class DataSourceDto {
    @Data
    public static class Add {
        @NotBlank(message = "英文名未填写")
        private String englishName;
        @NotBlank(message = "中文名未填写")
        private String chineseName;
        @NotNull(message = "未选择数据库类型")
        @Range(min = 1, max = 6, message = "选择的数据库类型不存在")
        private Short databaseType;
        @NotBlank(message = "用户名未填琯")
        private String userName;
        @NotBlank(message = "密码未填写")
        private String password;
        @NotBlank(message = "JNDI名称未填写")
        private String jndi;
        @NotBlank(message = "JDBC地址未填写")
        private String jdbcUrl;
        private String remark;
    }

    @Data
    public static class Update {
        @NotNull(message = "id未填写")
        private Integer id;
        @NotBlank(message = "英文名未填写")
        private String englishName;
        @NotBlank(message = "中文名未填写")
        private String chineseName;
        @NotNull(message = "未选择数据库类型")
        @Range(min = 1, max = 6, message = "选择的数据库类型不存在")
        private Short databaseType;
        @NotBlank(message = "用户名未填琯")
        private String userName;
        @NotBlank(message = "密码未填写")
        private String password;
        @NotBlank(message = "JNDI名称未填写")
        private String jndi;
        @NotBlank(message = "JDBC地址未填写")
        private String jdbcUrl;
        private String remark;
    }
}